<extend name="work/base_mini"/>
<block name="content">
    <div class="layui-card-body">
        <div class="layui-card">
            <div class="layui-card-header">微信授权</div>
            <div class="layui-card-body">
                <notempty name="info">
                    <table class="layui-table">
                        <tbody>
                        <tr>
                            <td>公众号名称</td>
                            <td>{$info.nick_name|default=''}</td>
                        </tr>
                        <tr>
                            <td>公众号类型</td>
                            <td>{$info.service_type_info|default=''}</td>
                        </tr>
                        <tr>
                            <td>公众号认证类型</td>
                            <td>{$info.verify_type_info|default=''}</td>
                        </tr>
                        <tr>
                            <td>公众号主体名称</td>
                            <td>{$info.principal_name|default=''}</td>
                        </tr>
                        <tr>
                            <td>模板行业</td>
                            <td>{$info.industry|default=''}</td>
                        </tr>
                        <tr>
                            <td>模板消息</td>
                            <td>{$info.template|default=''}</td>
                        </tr>
                        </tbody>
                    </table>


                </notempty>

                <a href="{$url}" class="layui-btn layui-btn-danger layui-btn-fluid">我已经准备好,现在授权微信管理员</a>
            </div>
        </div>

    </div>
    <script type="text/javascript">
        layui.use(['form', 'layer', 'formSelects', 'upload'], function () {
            var form = layui.form
                , formSelects = layui.formSelects
                , $ = layui.$
                , upload = layui.upload
                , laydate = layui.laydate;
            $('#industry').click(function () {
              var url=this.attr('url');
                $.ajax({
                    url: url,
                    type: 'POST',
                    dataType: 'json',
                    data: data.field
                })
                    .done(function (res) {
                            layer.msg(res.msg, {
                                offset: 'rt',
                                time: 1500,
                                icon: 5,
                                anim: 5
                            });
                    })
                    .fail(function () {
                        layer.msg('服务器没有反映', {
                            time: 1500,
                            icon: 5
                        });
                    })
                    .always(function () {
                        $('#vercode').click();
                        self.removeAttr('disabled');
                    });
                return false;
            });
            $('#template').click(function () {
                var url=this.attr('url');
                $.ajax({
                    url: url,
                    type: 'POST',
                    dataType: 'json',
                    data: data.field
                })
                    .done(function (res) {
                        layer.msg(res.msg, {
                            offset: 'rt',
                            time: 1500,
                            icon: 5,
                            anim: 5
                        });
                    })
                    .fail(function () {
                        layer.msg('服务器没有反映', {
                            time: 1500,
                            icon: 5
                        });
                    })
                    .always(function () {
                        $('#vercode').click();
                        self.removeAttr('disabled');
                    });
                return false;
            });


        });
    </script>
</block>
